package com.old.people.service.serviceImp;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.old.people.dao.ServicerMapper;
import com.old.people.entities.Appraisal;
import com.old.people.entities.Disease;
import com.old.people.entities.Funds;
import com.old.people.entities.OrderOldPeople;
import com.old.people.entities.Servicer;
import com.old.people.entities.Service;
import com.old.people.service.ServicerService;

@org.springframework.stereotype.Service
public class ServicerServiceImp implements ServicerService {
	@Autowired
	private ServicerMapper servicerMapper;

	@Override
	public List<Service> getService(String account_id) {
		return servicerMapper.getService(account_id);
	}

	@Override
	public boolean updateService(String service_id, String service_name, String service_content, String service_price,
			String service_type) {

		return servicerMapper.updateService(service_id, service_name, service_content, service_price, service_type);
	}

	@Override
	public boolean insertService(String account_id,String service_id, String service_name, String service_content, String service_price,
			String service_type) {
		boolean b1=servicerMapper.updateServicer(account_id, service_id);
		boolean b2=servicerMapper.insertService(service_id, service_name, service_content, service_price, service_type);
		if(b1&&b2) {
			return true;
		}
		return false;
	}

	@Override
	public Servicer getServicer(String account_id) {

		return servicerMapper.getServicer(account_id);
	}
	
	@Override
	public boolean updateServicers(String servicer_id, String servicer_name, String servicer_sex, String servicer_tel,
			String servicer_idcard) {
		return servicerMapper.updateServicers(servicer_id, servicer_name, servicer_sex, servicer_tel, servicer_idcard);
	}

	@Override
	public List<OrderOldPeople> getOrderOldPeople(String account_id, Integer begin) {
		return servicerMapper.getOrderOldPeople(account_id, begin);
	}
	
	@Override
	public Integer getOrderOldPeopleSum(String account_id) {
		return servicerMapper.getOrderOldPeopleSum(account_id);
	}
	

	@Override
	public List<Disease> getDisease(String oldpeople_id) {

		return servicerMapper.getDisease(oldpeople_id);
	}

	@Override
	public boolean updateDisease(String disease_id, String disease_parameter) {

		return servicerMapper.updateDisease(disease_id, disease_parameter);
	}

	@Override
	public boolean insertDisease(String disease_id, String disease_name, String disease_parameter,
			String oldpeople_id) {
		return servicerMapper.insertDisease(disease_id, disease_name, disease_parameter, oldpeople_id);
	}

	@Override
	public Integer getAppraisalSum(String account_id) {
		return servicerMapper.getAppraisalSum(account_id);
	}

	@Override
	public List<Appraisal> getAppraisal(String account_id,Integer begin) {
		return servicerMapper.getAppraisal(account_id,begin);
	}

	@Override
	public Integer getFundsSum(String account_id) {
		return servicerMapper.getFundsSum(account_id);
	}

	@Override
	public List<Funds> getFunds(String account_id, Integer begin) {
		return servicerMapper.getFunds(account_id, begin);
	}

}
